package org.crumbleworks.crumbchat.client;

import java.sql.Connection;

import org.crumbleworks.crumbchat.client.controller.ClientController;
import org.crumbleworks.crumbchat.common.data.Message;

import com.esotericsoftware.kryonet.Listener;

public class ClientListener extends Listener.ReflectionListener {
    private ClientController controller;

    public ClientListener(ClientController controller) {
        this.controller = controller;
    }

    public void connected(Connection connection) {
        controller.sendUserDataToServer();
    }

    public void disconnected(Connection connection) {

    }

    public void received(Connection connection, Message message) {
        controller.putMessageToChat(message);
    }
}
